<?
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://passport.baidu.com/?login');
curl_setopt($curl, CURLOPT_POST, false);

/*
解释SSL证书方案1：
绕过SSL验证
*/

//curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 0);
//curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);

/*
解释SSL证书方案2：
更新证书文件
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,true); ;
curl_setopt($curl,CURLOPT_CAINFO,dirname(__FILE__).'/Core/cacert.pem');
*/


$curl_res = curl_exec($curl);
echo $curl_res;
if (curl_errno($curl)) {
        echo 'Error: ' . curl_error($curl);
}
curl_close($curl);
?>
